<?php

/**
 * This is the model class for table "tbl_resp_ges_empty".
 *
 * The followings are the available columns in table 'tbl_resp_ges_empty':
 * @property integer $rem_id
 * @property string $rem_codigo
 * @property string $rem_resp
 * @property string $rem_resp_modulos
 * @property string $rem_tipobol
 * @property string $rem_posgrid
 * @property string $rem_pregunta
 * @property string $rem_column
 * @property string $rem_nivel
 * @property string $rem_fecha
 * @property string $rem_usuarios
 * @property integer $rem_estado
 */
class tbl_resp_ges_empty extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return tbl_resp_ges_empty the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'tbl_resp_ges_empty';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('rem_codigo, rem_resp, rem_resp_modulos, rem_tipobol, rem_pregunta, rem_nivel, rem_fecha, rem_usuarios, rem_estado', 'required'),
			array('rem_estado', 'numerical', 'integerOnly'=>true),
			array('rem_posgrid', 'length', 'max'=>10),
			array('rem_codigo', 'length', 'max'=>15),
			array('rem_resp, rem_pregunta', 'length', 'max'=>7),
			array('rem_resp_modulos', 'length', 'max'=>10),
			array('rem_tipobol', 'length', 'max'=>4),
			array('rem_column', 'length', 'max'=>150),
			array('rem_nivel', 'length', 'max'=>6),
			array('rem_usuarios', 'length', 'max'=>5),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('rem_id, rem_codigo, rem_resp, rem_resp_modulos, rem_tipobol, rem_posgrid, rem_pregunta, rem_column, rem_nivel, rem_fecha, rem_usuarios, rem_estado', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'respMain'=>array(self::BELONGS_TO, 'tbl_resp', array('rem_resp'=>'rma_codigo'))
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'rem_id' => 'Rem',
			'rem_codigo' => 'Rem Codigo',
			'rem_resp' => 'Rem Resp',
			'rem_resp_modulos' => 'Rem Resp Modulos',
			'rem_tipobol' => 'Rem Tipobol',
			'rem_posgrid' => 'Rem Posgrid',
			'rem_pregunta' => 'Rem Pregunta',
			'rem_column' => 'Rem Column',
			'rem_nivel' => 'Rem Nivel',
			'rem_fecha' => 'Rem Fecha',
			'rem_usuarios' => 'Rem Usuarios',
			'rem_estado' => 'Rem Estado',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('rem_id',$this->rem_id);

		$criteria->compare('rem_codigo',$this->rem_codigo,true);

		$criteria->compare('rem_resp',$this->rem_resp,true);

		$criteria->compare('rem_resp_modulos',$this->rem_resp_modulos,true);

		$criteria->compare('rem_tipobol',$this->rem_tipobol,true);

		$criteria->compare('rem_posgrid',$this->rem_posgrid,true);

		$criteria->compare('rem_pregunta',$this->rem_pregunta,true);

		$criteria->compare('rem_column',$this->rem_column,true);

		$criteria->compare('rem_nivel',$this->rem_nivel,true);

		$criteria->compare('rem_fecha',$this->rem_fecha,true);

		$criteria->compare('rem_usuarios',$this->rem_usuarios,true);

		$criteria->compare('rem_estado',$this->rem_estado);

		return new CActiveDataProvider('tbl_resp_ges_empty', array(
			'criteria'=>$criteria,
		));
	}
}